﻿/**	pair_type.hpp
 *	----	Create Time Stamp:	--2006-11-10 00:51:14--
 *-----------------------------------------------------------------------------
 *	Mean	:加强的 pair 类， 支持引用以及void等的传递
 *	Author	:Nick Shallery	(nicknide@gmail.com)
 *	Version	:1.0.7.7	(2009-03-13 01:43:23)
 *-----------------------------------------------------------------------------
**/	/*YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.*/


#if			!defined(__LOLIX__TOY__PAIR_TYPE__K_IN_G__)
#define		__LOLIX__TOY__PAIR_TYPE__K_IN_G__

#if			!defined(__LOLIX__TOY__STD_ALGORITHM__NICK__K_IN_G__)
	#include	"./std_algorithm.hpp"
#endif	//	!defined(__LOLIX__TOY__STD_ALGORITHM__NICK__K_IN_G__)
#if			!defined(__LOLIX__TOY__STD_FUNCTIONAL__NICK__K_IN_G__)
	#include	"./std_functional.hpp"
#endif	//	!defined(__LOLIX__TOY__STD_FUNCTIONAL__NICK__K_IN_G__)

namespace lolix{namespace toy{
	template<typename, typename>class	pair;
	template<typename _Tp>
	class	pair_value_first
		: public ::lolix::toy::unary_function<_Tp, typename _Tp::first_type>
	{
	public:
		result_type&	operator()(_Tp& val)const
		{
			return val.first;
		}
	};

	template<typename _Tp>
	class	pair_value_second
		: public ::lolix::toy::unary_function<_Tp, typename _Tp::second_type>
	{
	public:
		result_type&	operator ()(_Tp& val)const
		{
			return val.second;
		}
	};
}}


template<typename _Ty1, typename _Ty2>	//	标准的 pair 不支持 绑定引用以及不支持 void 类型
class lolix::toy::pair
{
public:
	typedef pair<_Ty1, _Ty2> this_type;
	typedef _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		second = _Right.second;
		return *this;
		}

	_Ty1 first;	// the first stored value
	_Ty2 second;	// the second stored value
};

template<typename _Ty1, typename _Ty2>	//	标准的 pair 不支持 绑定引用以及不支持 void 类型
class lolix::toy::pair<const _Ty1, _Ty2>
{
public:
	typedef pair<const _Ty1, _Ty2> this_type;
	typedef const _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		//lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		//first = _Right.first;
		second = _Right.second;
		return *this;
		}

	this_type& operator = ( const this_type& _Right )
		{
		//first = _Right.first;
		second = _Right.second;
		return *this;
		}

	const _Ty1 first;	// the first stored value
	_Ty2 second;	// the second stored value
};

template<typename _Ty1, typename _Ty2>	//	标准的 pair 不支持 绑定引用以及不支持 void 类型
class lolix::toy::pair<_Ty1, const _Ty2>
{
public:
	typedef pair<_Ty1, const _Ty2> this_type;
	typedef _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		//lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		//second = _Right.second;
		return *this;
		}

	_Ty1 first;			// the first stored value
	const _Ty2 second;	// the second stored value
};

template<typename _Ty1, typename _Ty2>	//	标准的 pair 不支持 绑定引用以及不支持 void 类型
class lolix::toy::pair<const _Ty1, const _Ty2>
{
public:
	typedef pair<const _Ty1, const _Ty2> this_type;
	typedef const _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	const _Ty1 first;	// the first stored value
	const _Ty2 second;	// the second stored value
private:
	void operator = (this_type&);
};

template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1&, _Ty2>
{
public:
	typedef pair<_Ty1&, _Ty2> this_type;
	typedef _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		second = _Right.second;
		}

	_Ty1&	first;	// the first stored value
	_Ty2	second;// the second stored value
};


template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1&, _Ty2>
{
public:
	typedef pair<const _Ty1&, _Ty2> this_type;
	typedef const _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		//lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		//first = _Right.first;
		second = _Right.second;
		}

	const _Ty1&	first;	// the first stored value
	_Ty2	second;		// the second stored value
};

template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1&, const _Ty2>
{
public:
	typedef pair<_Ty1&, const _Ty2> this_type;
	typedef _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		//lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		//second = _Right.second;
		}

	_Ty1&	first;	// the first stored value
	const _Ty2	second;// the second stored value
};


template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1&, const _Ty2>
{
public:
	typedef pair<const _Ty1&, const _Ty2> this_type;
	typedef const _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }


	const _Ty1&	first;	// the first stored value
	const _Ty2	second;// the second stored value
private:
	void operator = (this_type&);
};



template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1, _Ty2&>
{
public:
	typedef pair<_Ty1, _Ty2&> this_type;
	typedef _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		second = _Right.second;
		}

	_Ty1	first;	// the first stored value
	_Ty2&	second;// the second stored value
};

template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1, _Ty2&>
{
public:
	typedef pair<const _Ty1, _Ty2&> this_type;
	typedef const _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		//lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		//first = _Right.first;
		second = _Right.second;
		}

	this_type& operator = (const this_type& o)
		{
		second = o.second;
		}

	const _Ty1	first;	// the first stored value
	_Ty2&	second;// the second stored value
};

template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1, const _Ty2&>
{
public:
	typedef pair<_Ty1, const _Ty2&> this_type;
	typedef _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		//lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		//second = _Right.second;
		}

	_Ty1	first;	// the first stored value
	const _Ty2&	second;// the second stored value
};


template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1, const _Ty2&>
{
public:
	typedef pair<const _Ty1, const _Ty2&> this_type;
	typedef const _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	const _Ty1	first;	// the first stored value
	const _Ty2&	second;// the second stored value
private:
	void operator = ( this_type& );
};


template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1&, _Ty2&>
{
public:
	typedef pair<_Ty1&, _Ty2&> this_type;
	typedef _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		second = _Right.second;
		}

	_Ty1&	first;	// the first stored value
	_Ty2&	second;// the second stored value
};



template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1&, _Ty2&>
{
public:
	typedef pair<const _Ty1&, _Ty2&> this_type;
	typedef const _Ty1 first_type;
	typedef _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		//lolix::swap(first, _Right.first);
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		//first = _Right.first;
		second = _Right.second;
		}

	const _Ty1&	first;	// the first stored value
	_Ty2&	second;// the second stored value
};


template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<_Ty1&, const _Ty2&>
{
public:
	typedef pair<_Ty1&, const _Ty2&> this_type;
	typedef _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		//lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		//second = _Right.second;
		}

	_Ty1&	first;	// the first stored value
	const _Ty2&	second;// the second stored value
};



template<typename _Ty1, typename _Ty2>
struct lolix::toy::pair<const _Ty1&, const _Ty2&>
{
public:
	typedef pair<const _Ty1&, const _Ty2&> this_type;
	typedef const _Ty1 first_type;
	typedef const _Ty2 second_type;

	pair(){}
	pair(const _Ty1& _Val1, const _Ty2& _Val2)
		: first(_Val1), second(_Val2)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first), second(_Right.second)
		{ }

	const _Ty1&	first;	// the first stored value
	const _Ty2&	second;// the second stored value
private:
	void operator = (this_type&);
};




template<typename _Ty>
struct lolix::toy::pair<_Ty, void>
{
public:
	typedef pair<_Ty, void> this_type;
	typedef _Ty first_type;
	typedef void second_type;

	pair(){}
	pair(const _Ty& _Val)
		: first(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		}

	_Ty	first;	// the first stored value
};


template<typename _Ty>
struct lolix::toy::pair<_Ty&, void>
{
public:
	typedef pair<_Ty&, void> this_type;
	typedef _Ty first_type;
	typedef void second_type;

	pair(){}
	pair(const _Ty& _Val)
		: first(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(first, _Right.first);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		first = _Right.first;
		}

	_Ty&	first;	// the first stored value
};

template<typename _Ty>
struct lolix::toy::pair<const _Ty, void>
{
public:
	typedef pair<const _Ty, void> this_type;
	typedef const _Ty first_type;
	typedef void second_type;

	pair(){}
	pair(const _Ty& _Val)
		: first(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first)
		{ }

	const _Ty	first;	// the first stored value
private:
	void operator = (this_type);
};


template<typename _Ty>
struct lolix::toy::pair<const _Ty&, void>
{
public:
	typedef pair<const _Ty&, void> this_type;
	typedef const _Ty first_type;
	typedef void second_type;

	pair(const _Ty& _Val)
		: first(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: first(_Right.first)
		{ }

	const _Ty&	first;	// the first stored value
private:
	void operator = (this_type&);
};


template<typename _Ty>
struct lolix::toy::pair<void, _Ty>
{
public:
	typedef pair<void, _Ty> this_type;
	typedef void first_type;
	typedef _Ty second_type;

	pair(){}
	pair(const _Ty& _Val)
		: second(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		second = _Right.second;
		}

	_Ty	second;	// the second stored value
};


template<typename _Ty>
struct lolix::toy::pair<void, _Ty&>
{
public:
	typedef pair<void, _Ty&> this_type;
	typedef void first_type;
	typedef _Ty second_type;

	pair(){}
	pair(const _Ty& _Val)
		: second(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		second = _Right.second;
		}

	_Ty&	second;	// the second stored value
};


template<typename _Ty>
struct lolix::toy::pair<void, const _Ty>
{
public:
	typedef pair<void, const _Ty> this_type;
	typedef void first_type;
	typedef const _Ty second_type;

	pair(){}
	pair(const _Ty& _Val)
		: second(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: second(_Right.second)
		{ }

	void swap(this_type& _Right)
		{	// exchange contents with _Right
		lolix::swap(second, _Right.second);
		}

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
		{
		second = _Right.second;
		}

	const _Ty	second;	// the second stored value
};


template<typename _Ty>
struct lolix::toy::pair<void, const _Ty&>
{
public:
	typedef pair<void, const _Ty&> this_type;
	typedef void first_type;
	typedef const _Ty second_type;

	pair(){}
	pair(const _Ty& _Val)
		: second(_Val)
		{ }

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
		: second(_Right.second)
		{ }

	const _Ty&	second;	// the second stored value
private:
	void operator = ( this_type& );
};


template<>
struct lolix::toy::pair<void, void>
{
public:
	typedef pair<void, void> this_type;
	typedef void first_type;
	typedef void second_type;

	pair(){}

	template<typename _Other1, typename _Other2>
	pair(const pair<_Other1, _Other2>& _Right)
	{ }

	template<typename _O1, typename _O2>
	this_type& operator = ( const pair<_O1, _O2>& _Right )
	{ }
};

namespace lolix{namespace toy{
	template<typename _Tl, typename _Tr>
	pair<_Tl, _Tr> make_pair(_Tl tl, _Tr tr)
	{
		return pair<_Tl, _Tr>(tl, tr);
	}
}}

namespace lolix{namespace toy{
	template<typename _Cp = less>
	class cmp_pair_first
	{
		_Cp cp;
	public:
		LOLIX_INLINE_CALL	cmp_pair_first<_Cp>(void){}
		LOLIX_INLINE_CALL	cmp_pair_first<_Cp>(const _Cp& incp):cp(incp){}

		template<typename _Tl, typename _Tr, typename _Cl, typename _Cr>
		LOLIX_INLINE_CALL	bool operator ()( const pair<_Tl, _Tr>& l, const pair<_Cl, _Cr>& r)
		{
			return cp(l.first, r.first);
		}
		template<typename _Tl, typename _Tr, typename _Cl>
		LOLIX_INLINE_CALL	bool operator ()( const pair<_Tl, _Tr>& l, const _Cl& r)
		{
			return cp(l.first, r);
		}
		template<typename _Tl, typename _Cl, typename _Cr>
		LOLIX_INLINE_CALL	bool operator ()( const _Tl& l,const pair<_Cl, _Cr>& r)
		{
			return cp(l, r.first);
		}
	};

	template<typename _Cp = less>
	class cmp_pair_second
	{
		_Cp cp;
	public:
		LOLIX_INLINE_CALL	cmp_pair_second<_Cp>(void){}
		LOLIX_INLINE_CALL	cmp_pair_second<_Cp>(const _Cp& incp):cp(incp){}

		template<typename _Tl, typename _Tr, typename _Cl, typename _Cr>
		LOLIX_INLINE_CALL	bool operator ()( const pair<_Tl, _Tr>& l, const pair<_Cl, _Cr>& r)
		{
			return cp(l.second , r.second);
		}
		template<typename _Tl, typename _Tr, typename _Cl>
		LOLIX_INLINE_CALL	bool operator ()( const pair<_Tl, _Tr>& l, const _Cl& r)
		{
			return cp(l.second, r);
		}
		template<typename _Tl, typename _Cl, typename _Cr>
		LOLIX_INLINE_CALL	bool operator ()( const _Tl& l,const pair<_Cl, _Cr>& r)
		{
			return cp(l, r.second);
		}
	};

	template<typename _Ll, typename _Lr, typename _Rl, typename _Rr>
	bool operator == (pair<_Ll, _Lr>const& l, pair<_Rr, _Rl>const& r)
		{
		return l.first == r.first && l.second == r.second;
		}

	template<typename _Ll, typename _Lr, typename _Rl, typename _Rr>
	bool operator != (pair<_Ll, _Lr>const& l, pair<_Rr, _Rl>const& r)
		{
		return !(l == r);
		}
}}

namespace lolix{
	template<typename _Tl, typename _Tr>
	LOLIX_INLINE_CALL void swap(toy::pair<_Tl, _Tr>& tl, toy::pair<_Tl, _Tr>& tr)
	{ return tl.swap(tr); }
}

#endif	//	!defined(__LOLIX__TOY__PAIR_TYPE__K_IN_G__)
